<#include "/public/macro.html">
<form method="post" key="set-mine" enctype="multipart/form-data" action="/admin/servicecon/save.html" class="layui-form">
	<#if callOutConfig??><input type="hidden" name="id" value="${callOutConfig.id!''}"></#if>
	<div class="row">
		<div class="col-lg-12">
			<div class="ukefu-customer-div setting-wrapper">
				<div class="box default-box">
					<div class="box-header">
						<h3 class="box-title">业务全局配置</h3>
					</div>
					<div class="box-body ukefu-im-theme">
						<div class="row">
							<div class="col-lg-8">
								


								
								<!--  -->
								<div class="ukefu-webim-prop">
									<div class="ukefu-webim-tl" style="clear:both;">1、启用高级业务自定义功能</div>
									<div class="box-item">
										<div class="row">
											<div class="col-lg-8">
												<p>启用该项，开启高级业务功能项</p>
											</div>
											<div class="col-lg-4" style="text-align:right;">
												<input type="checkbox" name="enablebusinesscustom" lay-filter="enablebusinesscustom" title="启用" <#if callOutConfig?? && callOutConfig.enablebusinesscustom == true>checked="checked"</#if>>
											</div>
										</div>
									</div>
									<div class="box-item enablebusinesscustom"  <#if callOutConfig?? && callOutConfig.enablebusinesscustom == true><#else>style="display: none"</#if>>

										<div class="row" style="padding-top: 25px;">
											<div class="col-lg-8">
												<p>a、 在线客服启用自定义附加页签</p>
												<p style="color:#888888;font-size:13px;margin-top:10px;">启用后，在线客服坐席端的右侧，展示自定义的页签内容</p>
											</div>
											<div class="col-lg-4" style="text-align:right;">
												<div class="layui-input-block">
													<input type="checkbox" name="enableagentcustomtabs" lay-filter="enableagentcustomtabs"  title="启用" <#if callOutConfig?? && callOutConfig.enableagentcustomtabs == true>checked="checked"</#if>>
												</div>
											</div>
											
											<div class="col-lg-8 enableagentcustomtabs" <#if callOutConfig?? && callOutConfig.enableagentcustomtabs == true><#else>style="display: none;" </#if>>
												
												<div class="box-item" id="enableshortcut" style="position: relative;">
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>页签新增，<a id="wh_time_temp" href="#" onclick="add_enableagentcustomtabs();">"添加页签"</a></p>
														</div>
													</div>
													<!-- 配置子项 -->
													<div id="temp_enableshortcut">
														
														<#if callOutConfig.dataagentcustomtabs?? && callOutConfig.dataagentcustomtabs != ''>
														<#list callOutConfig.dataagentcustomtabsList as project>
														
															<div class="row ukefu-item" style="margin:10px 0px 0px 0px;">
																<div class="layui-form-item">
																    <label class="layui-form-label" style="width:75px;">展示类型：</label>
																    <div class="layui-input-inline"  style="width: 400px;">
																		<select name="displaytype">
																			<option value="embed" <#if project.type?? && project.type == 'embed'>selected="selected"</#if>>原页面嵌入</option>
																			<option value="popup" <#if project.type?? && project.type == 'popup'>selected="selected"</#if>>弹窗</option>
																			<option value="tabs" <#if project.type?? && project.type == 'tabs'>selected="selected"</#if>>新开页签</option>
																		</select>
																    </div>
																 </div>
																<div class="layui-form-item">
																    <label class="layui-form-label" style="width:75px;">页签名：</label>
																    <div class="layui-input-inline"  style="width: 400px;">
																      <input type="text" name="tabname" value="${project.title!''}" placeholder="请输入展示页签名"  autocomplete="off" class="layui-input">
																    </div>
																 </div>
																
																<div class="layui-form-item">
																    <label class="layui-form-label" style="width:75px;">链接：</label>
																    <div class="layui-input-inline"  style="width: 400px;">
																      <input type="text" name="taburl" value="<#if project.url??>${(project.url)?no_esc}</#if>"  placeholder="请输入跳转链接" autocomplete="off" class="layui-input">
																    </div>
																 </div>
																
																<div class='layui-input-inline' style='padding-top:8px;'>
																	<a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style='padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;'>
																		<i class='layui-icon'>&#x1006;</i>
																	</a>
																</div>
															</div>
														
														
														</#list>
														</#if>
														
														</div>
														<div id = "toptemp_enableagentcustomtabs">
															
														</div>
												</div>
											</div>
											
										</div>
									</div>
								</div>
								
								<div class="ukefu-webim-prop">
									<div class="ukefu-webim-tl" style="clear:both;">2、启用自定义工单状态</div>
									<div class="box-item">
										<div class="row">
											<div class="col-lg-8">
												<p>启用该项，开启自定义工单状态功能项</p>
											</div>
											<div class="col-lg-4" style="text-align:right;">
												<input type="checkbox" name="enablecuswodstatus" lay-filter="enablecuswodstatus" title="启用" <#if callOutConfig?? && callOutConfig.enablecuswodstatus == true>checked="checked"</#if>>
											</div>
										</div>
									</div>
									<div class="box-item enablecuswodstatus"  <#if callOutConfig?? && callOutConfig.enablecuswodstatus == true><#else>style="display: none"</#if>>

										<div class="row" style="padding-top: 25px;">
											<div class="col-lg-8">
												<p>工单状态字典项</p>
											</div>
											<div class="col-lg-4" style="text-align:right;">
												<div class="layui-input-block">
													<input type="text" name="cuswodstatusdic" value="${callOutConfig.cuswodstatusdic!''}"  placeholder="请输入字典项代码" autocomplete="off" class="layui-input">
												</div>
											</div>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
				</div>
				
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-3"></div>
		<div class="col-lg-9">
			<div class="layui-form-item">
			  <div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="formDemo">保存</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			  </div>
			</div>
		</div>
	</div>
</form>
<script type="text/javascript"> 	

	var form ;
	layui.use('form', function(){
	    form = layui.form;
		form.render();

		
		
		form.on('checkbox(enablebusinesscustom)', function (data) {
		　　  if(data.elem.checked == true){
				$('.enablebusinesscustom').show();		
			}else{
				$('.enablebusinesscustom').hide();
			}
		});
		
		form.on('checkbox(enableworkorderscreenurl)', function (data) {
		　　  if(data.elem.checked == true){
				$('.enableworkorderscreenurl').show();		
			}else{
				$('.enableworkorderscreenurl').hide();
			}
		});
		
		form.on('checkbox(enableworkordercustomurl)', function (data) {
		　　  if(data.elem.checked == true){
				$('.enableworkordercustomurl').show();		
			}else{
				$('.enableworkordercustomurl').hide();
			}
		});

		form.on("checkbox(enableagentcustomtabs)" , function(data){
			if(data.elem.checked == true){
				$('.enableagentcustomtabs').show();
			}else{
				$('.enableagentcustomtabs').hide();
			}
		});
		form.on("checkbox(enablecuswodstatus)" , function(data){
			if(data.elem.checked == true){
				$('.enablecuswodstatus').show();
			}else{
				$('.enablecuswodstatus').hide();
			}
		});
		

		
	});
	


	$(function(){
		$(document).on("click",".delnums",function(){
	  		$(this).closest(".numrow").remove();
	  		if($(".numrow").length==0){
	  			$("#numsmshead").hide();
	  		}
	    });
	});
	
	layui.use('colorpicker', function(){
	  var colorpicker = layui.colorpicker;
	   
		//表单赋值
	  colorpicker.render({
	    elem: '#tablerowbcolor-color'
	    ,color: '${callOutConfig.tablerowbcolor!'#ECECFF'}'
	    ,done: function(color){
	      $('#tablerowbcolor').val(color);
	    }
	  });
	  colorpicker.render({
	    elem: '#tablefontcolor-color'
	    ,color: '${callOutConfig.tablefontcolor!'#666'}'
	    ,done: function(color){
	      $('#tablefontcolor').val(color);
	    }
	  });
	});
	
	

	function removeItem(obj){
		$(obj).closest(".ukefu-item").remove();
	}
	function add_enableagentcustomtabs(){
		$('#toptemp_enableagentcustomtabs').append($('#tpl_enableagentcustomtabs').text());
		
		form.render();
	}
</script>
<script id="tpl_enableagentcustomtabs" type="text/html">
<div class="row ukefu-item" style="margin:10px 0px 0px 0px;">
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:75px;">展示类型：</label>
		<div class="layui-input-inline"  style="width: 400px;">
			<select name="displaytype">
				<option value="embed" >原页面嵌入</option>
				<option value="popup" >弹窗</option>
				<option value="tabs" >新开页签</option>
			</select>
		</div>
	 </div>
	<div class="layui-form-item">
		<label class="layui-form-label" style="width:75px;">页签名：</label>
		<div class="layui-input-inline"  style="width: 400px;">
		  <input type="text" name="tabname"  placeholder="请输入展示页签名"  autocomplete="off" class="layui-input">
		</div>
	 </div>

	<div class="layui-form-item">
		<label class="layui-form-label" style="width:75px;">链接：</label>
		<div class="layui-input-inline"  style="width: 400px;">
		  <input type="text" name="taburl"   placeholder="请输入跳转链接"  autocomplete="off" class="layui-input">
		</div>
	 </div>

	<div class='layui-input-inline' style='padding-top:8px;'>
		<a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style='padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;'>
			<i class='layui-icon'>&#x1006;</i>
		</a>
	</div>
	</div>
</script>